<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var height = prompt("请输入身高")
        var kg = prompt("请输入体重")
        var BMI = kg / height * height
        if (BMI <= 18.4) {
            alert("你的体质是偏瘦")
        } else if (BMI >= 18.5 & BMI <= 23.9) {
            alert("你的体质是正常")
        } else if (BMI >= 24.0 & BMI <= 27.9) {
            alert("你的体质是偏重")
        } else {
            alert("你的体重是肥胖")
        }
    </script>
</body>

</html>